package org.ccay.validator.validators;



/**
 * <!-- START SNIPPET: javadoc -->
 * Validates a field using an OGNL expression.
 * <!-- END SNIPPET: javadoc -->
 * <p/>
 * 
 * <!-- START SNIPPET: parameters -->
 * <ul>
 *    <li>fieldName - The field name this validator is validating. Required if using Plain-Validator Syntax otherwise not required</li>
 *    <li>expression - The Ognl expression (must evaluate to a boolean) which is to be evalidated the stack</li>
 * </ul>
 * <!-- END SNIPPET: parameters -->
 * 
 * <pre>
 * <!-- START SNIPPET: example -->
 *    &lt;!-- Plain Validator Syntax --&gt;
 *    &lt;validators&gt;
 *        &lt;!-- Plain Validator Syntax --&gt;
 *        &lt;validator type="fieldexpression"&gt;
 *           &lt;param name="fieldName"&gt;myField&lt;/param&gt;
 *           &lt;param name="expression"&gt;&lt;![CDATA[#myCreditLimit &gt; #myGirfriendCreditLimit]]&gt;&lt;/param&gt;
 *           &lt;message&gt;My credit limit should be MORE than my girlfriend&lt;/message&gt;
 *        &lt;validator&gt;
 *        
 *        &lt;!-- Field Validator Syntax --&gt;
 *        &lt;field name="myField"&gt;
 *            &lt;field-validator type="fieldexpression"&gt;
 *                &lt;param name="expression"&gt;&lt;![CDATA[#myCreditLimit &gt; #myGirfriendCreditLimit]]&gt;&lt;/param&gt;
 *                &lt;message&gt;My credit limit should be MORE than my girlfriend&lt;/message&gt;
 *            &lt;/field-validator&gt;
 *        &lt;/field&gt;
 *        
 *    &lt;/vaidators&gt;
 * <!-- END SNIPPET: example -->
 * </pre>
 * 
 *
 * 
 * @version $Revision: 1063 $
 */
public class FieldExpressionValidator extends AbstractExpressionValidator {

    /* (non-Javadoc)
     * @see org.ccay.validator.validators.AbstractExpressionValidator#processMessage(java.lang.String, java.lang.Object)
     */
    public void processMessage(String fieldName, Object object){
    	addFieldError(fieldName, object);
    }
}
